import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# 生成等差时间数列
time_arange=pd.date_range(start='2022-01-01',periods=365,freq="D")
# 生成等间隔时间序列
time_linspace=pd.date_range(start='2022-01-01',end='2022-12-31',freq='D')
# 绘制时间序列
plt.figure(figsize=(10,4))
plt.subplot(1,2,1)
plt.plot(time_arange,np.random.randn(len(time_arange)),label='arange')
plt.title('Using arange()')
plt.legend()
plt.subplot(1,2,2)
plt.plot(time_linspace,np.random.randn(len(time_linspace)),label='linspace')
plt.title('Using linspace()')
plt.legend()
plt.show()